Having trouble rotating a turret

I need to rotate a turret around the Z axis. The turret is successfully rotating around the z axis however, the turrets x rotation becomes 0 when it should stay at -90, and i cannot figure out how to rotate the turret and keep the x rotation at -90.
Here is the code i have to rotate the turret.`public class PT_Turret_rotate : MonoBehaviour
{

public GameObject player;

private Vector3 lookDir;

private void Update()
{
    lookDir = player.transform.position - transform.position;
    lookDir.y = 0;
    transform.rotation = Quaternion.LookRotation(lookDir);
}

I think the problem is the vector you are passing to the LookRotation method. You said that you:

need to rotate a turret around the Z axis

This means that you will only move in Z degrees and X and Y degrees should always be 0. However, you are passing a vector that will result in a rotation around the Y axis (depending on how the player can move). So what you need to is leave the X and Y values as they are and set the Z value to zero instead.